import { defaultCheckboxProps } from "@/utils/default"
import type { QuestionCheckboxPropsType } from "@/utils/type"

import { Checkbox,  Space, Typography } from "antd"

const { Paragraph } = Typography




export default function QuestionCheckbox(props: QuestionCheckboxPropsType) {
  const { title, isVertical, options=[]} = { ...defaultCheckboxProps, ...props }
  return (
    <div>
      <Paragraph strong>{title}</Paragraph>
        {/* 换行 */}
        <Space style={{ flexWrap: 'wrap' }} direction={isVertical ? "vertical" : "horizontal"}>
          {options.map(item => {
            return <Checkbox checked={item.checked} value={item.value} key={item.value}>{item.label}</Checkbox>
          })}
        </Space>

    </div>
  )
}
